using System;
using UnityEngine.UI;
using UnityEngine;

[Serializable]
public class TextColorAnima : EasyAnimBase
{
    public Gradient gradient;
    public Text text;
}

public class TextColorAnimation : EasyAnimation<TextColorAnima>
{
    protected override void Awake()
    {
        base.Awake();
        for (int i = 0; i < anims.Length; i++)
        {
            anims[i].text = anims[i].targetObject.GetComponent<Text>();
        }
    }

    protected override void ApplyAnim(TextColorAnima anim, float process)
    {
        Color val = anim.gradient.Evaluate(process) * anim.multiply;
        anim.text.color = val;
    }
}
